Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[main] adds target namsepace metadata support #2132

Merged
merged 1 commit into from
May 10, 2024

Conversation

jkandasa
Copy link
Member

Changes

  • Adds target namespace metadata support via TektonConfig CR
  • fixes: SRVKP-3593 - Ability to manage metadata on targetNamespace
  • Sample:
    spec:
      targetNamespaceMetadata:
        labels:
          label1: value1
          label2: value2
        annotations:
          key1: value1
          key2: value2
    

Submitter Checklist

These are the criteria that every PR should meet, please check them off as you
review them:

See the contribution guide for more details.

Release Notes

Under TektonConfig CR, `spec.targetNamespaceMetadata` allows user to update their custom `labels` and `annotations` to the target namespace.

@tekton-robot tekton-robot added the release-note Denotes a PR that will be considered when it comes time to generate release notes. label Apr 30, 2024
@tekton-robot tekton-robot added the size/L Denotes a PR that changes 100-499 lines, ignoring generated files. label Apr 30, 2024
@tekton-robot
Copy link
Contributor

The following is the coverage report on the affected files.
Say /test pull-tekton-operator-go-coverage to re-run this coverage report

File Old Coverage New Coverage Delta
pkg/apis/operator/v1alpha1/common.go 100.0% 85.7% -14.3
pkg/reconciler/common/targetnamespace.go 86.9% 89.9% 3.0

@@ -72,14 +73,25 @@ type TektonComponentStatus interface {
type CommonSpec struct {
// TargetNamespace is where resources will be installed
// +optional
TargetNamespace string `json:"targetNamespace,omitempty"`
TargetNamespace string `json:"targetNamespace,omitempty"`
TargetNamespaceMetadata *NamespaceMetadata `json:"targetNamespaceMetadata,omitempty"`
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

my only concern is this field is getting used in all component crd also, like optional component, and if some different data provided in both crs, how we will handle that? is not better to move this out of common spec as it is specific to config?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@piyush-garg this metadata should goes in to the specific targetNamespace, If we have different namespace in different CR/Component, targetNamespaceMetadata is applicable to the targetNamespace

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@piyush-garg I removed the namespace meta support from common.
Now it is only applicable to TektonConfig CR.

@tekton-robot
Copy link
Contributor

The following is the coverage report on the affected files.
Say /test pull-tekton-operator-go-coverage to re-run this coverage report

File Old Coverage New Coverage Delta
pkg/reconciler/common/targetnamespace.go 86.9% 89.2% 2.3
pkg/reconciler/kubernetes/tektonhub/tektonhub.go Do not exist 0.0%
pkg/reconciler/shared/tektonconfig/tektonconfig.go Do not exist 0.0%

@jkandasa
Copy link
Member Author

/retest-required

@piyush-garg
Copy link
Contributor

/approve

@tekton-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: piyush-garg

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@tekton-robot tekton-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label May 10, 2024
@piyush-garg
Copy link
Contributor

/lgtm

@tekton-robot tekton-robot added the lgtm Indicates that a PR is ready to be merged. label May 10, 2024
@savitaashture
Copy link
Contributor

/hold

Reviewing PR

@tekton-robot tekton-robot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label May 10, 2024
@savitaashture
Copy link
Contributor

/hold cancel

@tekton-robot tekton-robot removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label May 10, 2024
@savitaashture
Copy link
Contributor

LGTM

@tekton-robot tekton-robot merged commit 9c6e27b into tektoncd:main May 10, 2024
8 checks passed
@jkandasa jkandasa deleted the support_ns_meta branch May 12, 2024 05:31
@jkandasa jkandasa added the kind/feature Categorizes issue or PR as related to a new feature. label May 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. kind/feature Categorizes issue or PR as related to a new feature. lgtm Indicates that a PR is ready to be merged. release-note Denotes a PR that will be considered when it comes time to generate release notes. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants